﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PersistentObject.Common.Schema
{
    public class TableInfo
    {
        /// <summary>
        /// Initialize an instance of table info
        /// </summary>
        public TableInfo()
        {
            ColumnList = new List<ColumnInfo>();
        }

        /// <summary>
        /// Indicate the persist name
        /// </summary>
        /// 
        public string Name { get; internal set; }

        /// <summary>
        /// Indicate the mapping type
        /// </summary>
        public Type Type { get; internal set; }

        /// <summary>
        /// Indicate whether the type would be persisted
        /// </summary>
        public bool NonPersist { get; internal set; }

        /// <summary>
        /// Contain the list of columns
        /// </summary>
        public List<ColumnInfo> ColumnList { get; internal set; }

        public ColumnInfo KeyColumn { get; internal set; }

        public override string ToString()
        {
            return string.Format("{0}, key:{1}", Name, KeyColumn.Name);
        }
    }
}
